package main

import (
	"fmt"

	"github.com/louloulin/dataflare/pkg/workflow/connector"
)

func main() {
	// Get connector factory
	factory := connector.DefaultRegistry.GetFactory()

	fmt.Println("Registered Source Connectors:")
	// List source connectors
	sourceTypes := []string{"memory", "file", "csv", "parquet", "http", "mysql"}
	for _, sourceType := range sourceTypes {
		// Try to create the connector
		_, err := factory.CreateSourceConnector(sourceType)
		if err == nil {
			fmt.Printf("  %s ✓\n", sourceType)
		} else {
			fmt.Printf("  %s ✗ (%v)\n", sourceType, err)
		}
	}

	fmt.Println("\nRegistered Sink Connectors:")
	// List sink connectors
	sinkTypes := []string{"memory", "file", "csv", "parquet", "console", "http", "mysql"}
	for _, sinkType := range sinkTypes {
		// Try to create the connector
		_, err := factory.CreateSinkConnector(sinkType)
		if err == nil {
			fmt.Printf("  %s ✓\n", sinkType)
		} else {
			fmt.Printf("  %s ✗ (%v)\n", sinkType, err)
		}
	}

	// Check MySQL source connector
	fmt.Println("\nTesting MySQL source connector:")
	source, err := factory.CreateSourceConnector("mysql")
	if err != nil {
		fmt.Printf("  Failed to create MySQL source connector: %v\n", err)
	} else {
		fmt.Printf("  Created MySQL source connector: %T\n", source)
	}

	// Check MySQL sink connector
	fmt.Println("\nTesting MySQL sink connector:")
	sink, err := factory.CreateSinkConnector("mysql")
	if err != nil {
		fmt.Printf("  Failed to create MySQL sink connector: %v\n", err)
	} else {
		fmt.Printf("  Created MySQL sink connector: %T\n", sink)
	}
}
